* OPEN STATA OUTPUT FILE LOG *


log using "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Output/APPENDIX I.WALD TESTS.04-19-2021.smcl", replace


   
   ****** CASES NATURALLY OMITTED WHERE AGENCY IDEOLOGY IS A MISSING VALUE SINCE NO ESTIMATE IS AVAILABLE FOR SUCH AGENCIES FOR N = 67 NOMINEE CASES    
   ******  [TRUNCATED + FULL SAMPLE: N = 1,278] FOR COMPARABILITY PURPOSES DUE TO "SENMAJAGENCYIDEOLOPPOSE" & "SENMAJAGENCYIDEOLALIGN" COVARIATES PREMISED ON AGENCY IDEOLOGY **** 

   
   
   ****** ANALYSIS OF MANUSCRIPT MODELS PROGRAM FILE: OMITTING SAMPLE SELECTION BIAS FROM N = 265 UNCONFIRMED CASES, ///
   ******  BUT ACCOUNTING FOR 22 RIGHT-CENSORED CASES CONFIRMED IN FUTURE CONGRESS OBSERVED IN KRAUSE & O'CONNELL DATABASE [NOT THWARTED BY FORMAL PROCEDURES] ****** 
   
   


   
   
    **** PROGRAM FILE FOR "CONFIRMATION DYNAMICS" PROJECT: TESTING 'DUE DILIGENCE' THEORY HYPOTHESES [N = 1,013: N = 991: UNCENSORED, N = 22: CENSORED] ****
   
   

   
   **** QUANTILE SURVIVAL MODELS: ASYMMETRIC LAPLACE MLE CONDITIONAL DENSITY SURVIVAL MODELS OF CONFIRMATION DECAY ****
 
 

 * OPEN UPDATED "CONFIRMATION DYNAMICS" DATABASE [08-13-2020] *

use "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Data/Confirmation Dynamics.Database.08-13-2020.FINAL.dta", replace



******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************



*** "DUE DILIGENCE" CONTEXTUAL EFFECTS BASED ON POSITION TYPE [TIER 1 VERSUS TIER 2 NOMINEE SLOPE DIFFERENCES] ***
*** NOTE: CONTEXTUAL VARIABLES THAT APPEAR MULTIPLICATIVE/INTERACTION FORM ARE RESCALED TO BE ZERO BOUNDED FOR EASE OF INTERPRETATION OF ADDITIVE BASELINE EFFECTS ***



***************************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************
*******************************************************************************************************************************************************************************




**** OUTCOME EQUATIONS: PREDICT CONFIRMATION DELAY DURATION (IN DAYS) USING SINGLE RECORD EVENTS ****






** H1 & H2: CONDITIONAL POLITICAL FRAGMENTATION EFFECTS [INTER-BRANCH & INTRA-BRANCH COORDINATION] CONDITIONED BY NOMINEE POSITION TYPE ***



** BASIS FOR H1: SOP/EXTERNAL FRAGMENTATION BETWEEN PRESIDENT AND SENATE SHOULD EXACERBATE DELAY MORE FOR "TIER 2" NOMINEES COMPARED TO "TIER 1" NOMINEES **

** BASIS FOR H2: INTERNAL LEGISLATIVE FRAGMENTATION WITHIN THE SENATE MAKE COORDINATION COSTS HIGHER FOR "TIER 2" NOMINEES COMPARED TO "TIER 1" NOMINEES **



***  H3 & H4:  CONDITIONAL ADMINISTRATIVE RESPONSIVENESS EFFECTS [AGENCY INSULATION AND PRESIDENTIAL LOYALTY] CONDITIONED BY NOMINEE POSITION TYPE ***




*** NOTE: "ZB" refers to rescaled measures of key covariates scores that equal (or approximtately equal) zero for the covariate in question *** 



*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** PART 1: MODELS ANALAYZING OVERALL/TOTAL CONFIRMATION DELAY [CONFIRMATION DATE - NOMINATION DATE] *** 


                                                                                                                                                                                                                                                               

*** MODEL 1: PREDICTING TIME FROM NOMINATION TO TIME TO CONFIRMATION ON SENATE FLOOR [confdur] - NON-AUGMENTED MODEL (DOES NOT ACCOUNT FOR SAMPLE SELECTION BIAS) ****


 
*** ASYMMETRIC LAPLACE MLE CONDITIONAL QUANTILE SURVIVAL REGRESSION PERCENTILES ["DUE DILIGENCE" MODEL] ***

laplacereg confdur filipresdistancelewiszb filipresdistlewiszbtoplev2  senpartydiffmedianlewiszb senpartydiffmedlewiszbtoplev2  senworkload senhearing excalendarcong ///
senmajagencyideoloppose senmajagencyideolalign agencyindzb  agencyindzbtoplev2  soucountagency1  presappnom endsession newpresterm fvatreated ///
toplevel2 zloyalmedianzb zloyalmedianzbtoplev2 zmecompmedian zpecompmedian  gender minority admintermyr1  admintermyr2 admintermyr3 ///
bush41 clinton bush43 if confirmselectin==1, failure(confirmobserved) quantiles (1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ///
seed(123) reps(1000)
*
estimates store model1
estout model1, cells(b(star fmt(3)) se(par fmt(2)))



*** WALD TESTS FOR JOINT COEFFICIENT EQUALITY AMONG CONDITIONAL EFFECTS POSITED BY H1-H4 IN MANUSCRIPT ***

** NULL HYPOTHESIS: EQUIVALENT TO MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
** ALTERNATIVE HYPOTHESIS: REJECT EQUIVALENCE OF MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
*
*
test [q01]filipresdistlewiszbtoplev2 = [q01]senpartydiffmedlewiszbtoplev2 = [q01]agencyindzbtoplev2 = [q01]zloyalmedianzbtoplev2 = 0
*
test [q05]filipresdistlewiszbtoplev2 = [q05]senpartydiffmedlewiszbtoplev2 = [q05]agencyindzbtoplev2 = [q05]zloyalmedianzbtoplev2 = 0
*
test [q10]filipresdistlewiszbtoplev2 = [q10]senpartydiffmedlewiszbtoplev2 = [q10]agencyindzbtoplev2 = [q10]zloyalmedianzbtoplev2 = 0
*
test [q15]filipresdistlewiszbtoplev2 = [q15]senpartydiffmedlewiszbtoplev2 = [q15]agencyindzbtoplev2 = [q15]zloyalmedianzbtoplev2 = 0
*
test [q20]filipresdistlewiszbtoplev2 = [q20]senpartydiffmedlewiszbtoplev2 = [q20]agencyindzbtoplev2 = [q20]zloyalmedianzbtoplev2 = 0
*
test [q25]filipresdistlewiszbtoplev2 = [q25]senpartydiffmedlewiszbtoplev2 = [q25]agencyindzbtoplev2 = [q25]zloyalmedianzbtoplev2 = 0
*
test [q30]filipresdistlewiszbtoplev2 = [q30]senpartydiffmedlewiszbtoplev2 = [q30]agencyindzbtoplev2 = [q30]zloyalmedianzbtoplev2 = 0
*
test [q35]filipresdistlewiszbtoplev2 = [q35]senpartydiffmedlewiszbtoplev2 = [q35]agencyindzbtoplev2 = [q35]zloyalmedianzbtoplev2 = 0
*
test [q40]filipresdistlewiszbtoplev2 = [q40]senpartydiffmedlewiszbtoplev2 = [q40]agencyindzbtoplev2 = [q40]zloyalmedianzbtoplev2 = 0
*
test [q45]filipresdistlewiszbtoplev2 = [q45]senpartydiffmedlewiszbtoplev2 = [q45]agencyindzbtoplev2 = [q45]zloyalmedianzbtoplev2 = 0
*
test [q50]filipresdistlewiszbtoplev2 = [q50]senpartydiffmedlewiszbtoplev2 = [q50]agencyindzbtoplev2 = [q50]zloyalmedianzbtoplev2 = 0
*
test [q55]filipresdistlewiszbtoplev2 = [q55]senpartydiffmedlewiszbtoplev2 = [q55]agencyindzbtoplev2 = [q55]zloyalmedianzbtoplev2 = 0
*
test [q60]filipresdistlewiszbtoplev2 = [q60]senpartydiffmedlewiszbtoplev2 = [q60]agencyindzbtoplev2 = [q60]zloyalmedianzbtoplev2 = 0
*
test [q65]filipresdistlewiszbtoplev2 = [q65]senpartydiffmedlewiszbtoplev2 = [q65]agencyindzbtoplev2 = [q65]zloyalmedianzbtoplev2 = 0
*
test [q70]filipresdistlewiszbtoplev2 = [q70]senpartydiffmedlewiszbtoplev2 = [q70]agencyindzbtoplev2 = [q70]zloyalmedianzbtoplev2 = 0
*
test [q75]filipresdistlewiszbtoplev2 = [q75]senpartydiffmedlewiszbtoplev2 = [q75]agencyindzbtoplev2 = [q75]zloyalmedianzbtoplev2 = 0
*
test [q80]filipresdistlewiszbtoplev2 = [q80]senpartydiffmedlewiszbtoplev2 = [q80]agencyindzbtoplev2 = [q80]zloyalmedianzbtoplev2 = 0
*
test [q85]filipresdistlewiszbtoplev2 = [q85]senpartydiffmedlewiszbtoplev2 = [q85]agencyindzbtoplev2 = [q85]zloyalmedianzbtoplev2 = 0
*
test [q90]filipresdistlewiszbtoplev2 = [q90]senpartydiffmedlewiszbtoplev2 = [q90]agencyindzbtoplev2 = [q90]zloyalmedianzbtoplev2 = 0
*
test [q95]filipresdistlewiszbtoplev2 = [q95]senpartydiffmedlewiszbtoplev2 = [q95]agencyindzbtoplev2 = [q95]zloyalmedianzbtoplev2 = 0
*
test [q99]filipresdistlewiszbtoplev2 = [q99]senpartydiffmedlewiszbtoplev2 = [q99]agencyindzbtoplev2 = [q99]zloyalmedianzbtoplev2 = 0
*
*
*
putexcel set "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use1wald.xlsx", modify
local i=1
foreach h in 01 05 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99 {
quietly test [q`h']filipresdistlewiszbtoplev2 = [q`h']senpartydiffmedlewiszbtoplev2 = [q`h']agencyindzbtoplev2 = [q`h']zloyalmedianzbtoplev2 = 0   
gen pointestimates`h' = r(chi2)
gen pval`h' = r(p)
putexcel A`i'= `h'
putexcel B`i'= (r(chi2))
putexcel C`i'=(r(p))
local i=`i'+1
}
import excel "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use1wald.xlsx", sheet("Sheet1") clear
replace B = round(B,.01)
replace C = round(C,.01)
replace C = .01 if C == 0
generate group = . 
replace group = 1 if C > 0.10
replace group = 2 if C <= 0.10 & C > 0.05
replace group = 3 if C <= 0.05 & C > 0.01
replace group = 4 if C <=0.01

twoway (bar B A, sort xlabel(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ylabel(0(10)30, angle(0)) ytitle("Wald Chi-Square Test Statistic", size(medsmall)) xtitle("Quantiles", size(medsmall)) title("FIGURE I.1: Overall Confirmation Delay Model", size(medium)) subtitle("(Wald Tests: Joint Significance of Conditional Agency Hierarchy Position Effects)", size(medsmall)) legend(off)) ///
       (bar B A if group == 1, barwidth(2) fcolor(white)) ///
       (bar B A if group == 2, barwidth(2) fcolor(gs13)) ///
	   (bar B A if group == 3, barwidth(2) fcolor(gs7)) ///
	   (bar B A if group == 4, barwidth(2) fcolor(black)) ///
	   (scatter B A, msymbol(none) mlabel(C) mlabposition(12) mlabgap(zero))
	   
graph save "Graph" "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/FigureI1.gph"

graph export "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/EPS/Appendix I/FigureI1.eps"

***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
 

 



*** PART 2: MODELS ANALYZING SENATE COMMITTEE CONFIRMATION DELAY: INFORMATIONAL VETTING [REPORTED OUT OF SENATE COMMITTEE DATE - NOMINATION DATE] *** 


use "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Data/Confirmation Dynamics.Database.08-13-2020.FINAL.dta", replace


************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************ 
                                                                                                                                                                                                                                                                   

*** MODEL 2: PREDICTING TIME FROM NOMINATION TO TIME TO REPORTED OUT OF SENATE COMMITTEE [LEGVETDUR] - NON-AUGMENTED MODEL (DOES NOT ACCOUNT FOR SAMPLE SELECTION BIAS) ****

  
     
*** ASYMMETRIC LAPLACE MLE CONDITIONAL QUANTILE SURVIVAL REGRESSION PERCENTILES ["DUE DILIGENCE" MODEL] ***


laplacereg legvetdur  filipresdistancelewiszb filipresdistlewiszbtoplev2  senpartydiffmedianlewiszb senpartydiffmedlewiszbtoplev2  senworkload senhearing excalendarcong ///
senmajagencyideoloppose senmajagencyideolalign agencyindzb  agencyindzbtoplev2  soucountagency1  presappnom endsession newpresterm fvatreated  ///
toplevel2 zloyalmedianzb zloyalmedianzbtoplev2 zmecompmedian zpecompmedian  gender minority admintermyr1  admintermyr2 admintermyr3 ///
bush41 clinton bush43 if confirmselectin==1, failure(confirmobserved) quantiles (1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ///
seed(123) reps(1000)
*
estimates store model2
estout model2, cells(b(star fmt(3)) se(par fmt(2)))



*** WALD TESTS FOR JOINT COEFFICIENT EQUALITY AMONG CONDITIONAL EFFECTS POSITED BY H1-H4 IN MANUSCRIPT ***

** NULL HYPOTHESIS: EQUIVALENT TO MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
** ALTERNATIVE HYPOTHESIS: REJECT EQUIVALENCE OF MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
*
*
test [q01]filipresdistlewiszbtoplev2 = [q01]senpartydiffmedlewiszbtoplev2 = [q01]agencyindzbtoplev2 = [q01]zloyalmedianzbtoplev2 = 0
*
test [q05]filipresdistlewiszbtoplev2 = [q05]senpartydiffmedlewiszbtoplev2 = [q05]agencyindzbtoplev2 = [q05]zloyalmedianzbtoplev2 = 0
*
test [q10]filipresdistlewiszbtoplev2 = [q10]senpartydiffmedlewiszbtoplev2 = [q10]agencyindzbtoplev2 = [q10]zloyalmedianzbtoplev2 = 0
*
test [q15]filipresdistlewiszbtoplev2 = [q15]senpartydiffmedlewiszbtoplev2 = [q15]agencyindzbtoplev2 = [q15]zloyalmedianzbtoplev2 = 0
*
test [q20]filipresdistlewiszbtoplev2 = [q20]senpartydiffmedlewiszbtoplev2 = [q20]agencyindzbtoplev2 = [q20]zloyalmedianzbtoplev2 = 0
*
test [q25]filipresdistlewiszbtoplev2 = [q25]senpartydiffmedlewiszbtoplev2 = [q25]agencyindzbtoplev2 = [q25]zloyalmedianzbtoplev2 = 0
*
test [q30]filipresdistlewiszbtoplev2 = [q30]senpartydiffmedlewiszbtoplev2 = [q30]agencyindzbtoplev2 = [q30]zloyalmedianzbtoplev2 = 0
*
test [q35]filipresdistlewiszbtoplev2 = [q35]senpartydiffmedlewiszbtoplev2 = [q35]agencyindzbtoplev2 = [q35]zloyalmedianzbtoplev2 = 0
*
test [q40]filipresdistlewiszbtoplev2 = [q40]senpartydiffmedlewiszbtoplev2 = [q40]agencyindzbtoplev2 = [q40]zloyalmedianzbtoplev2 = 0
*
test [q45]filipresdistlewiszbtoplev2 = [q45]senpartydiffmedlewiszbtoplev2 = [q45]agencyindzbtoplev2 = [q45]zloyalmedianzbtoplev2 = 0
*
test [q50]filipresdistlewiszbtoplev2 = [q50]senpartydiffmedlewiszbtoplev2 = [q50]agencyindzbtoplev2 = [q50]zloyalmedianzbtoplev2 = 0
*
test [q55]filipresdistlewiszbtoplev2 = [q55]senpartydiffmedlewiszbtoplev2 = [q55]agencyindzbtoplev2 = [q55]zloyalmedianzbtoplev2 = 0
*
test [q60]filipresdistlewiszbtoplev2 = [q60]senpartydiffmedlewiszbtoplev2 = [q60]agencyindzbtoplev2 = [q60]zloyalmedianzbtoplev2 = 0
*
test [q65]filipresdistlewiszbtoplev2 = [q65]senpartydiffmedlewiszbtoplev2 = [q65]agencyindzbtoplev2 = [q65]zloyalmedianzbtoplev2 = 0
*
test [q70]filipresdistlewiszbtoplev2 = [q70]senpartydiffmedlewiszbtoplev2 = [q70]agencyindzbtoplev2 = [q70]zloyalmedianzbtoplev2 = 0
*
test [q75]filipresdistlewiszbtoplev2 = [q75]senpartydiffmedlewiszbtoplev2 = [q75]agencyindzbtoplev2 = [q75]zloyalmedianzbtoplev2 = 0
*
test [q80]filipresdistlewiszbtoplev2 = [q80]senpartydiffmedlewiszbtoplev2 = [q80]agencyindzbtoplev2 = [q80]zloyalmedianzbtoplev2 = 0
*
test [q85]filipresdistlewiszbtoplev2 = [q85]senpartydiffmedlewiszbtoplev2 = [q85]agencyindzbtoplev2 = [q85]zloyalmedianzbtoplev2 = 0
*
test [q90]filipresdistlewiszbtoplev2 = [q90]senpartydiffmedlewiszbtoplev2 = [q90]agencyindzbtoplev2 = [q90]zloyalmedianzbtoplev2 = 0
*
test [q95]filipresdistlewiszbtoplev2 = [q95]senpartydiffmedlewiszbtoplev2 = [q95]agencyindzbtoplev2 = [q95]zloyalmedianzbtoplev2 = 0
*
test [q99]filipresdistlewiszbtoplev2 = [q99]senpartydiffmedlewiszbtoplev2 = [q99]agencyindzbtoplev2 = [q99]zloyalmedianzbtoplev2 = 0
*
*
*
putexcel set "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use2wald.xlsx", modify
local i=1
foreach h in 01 05 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99 {
quietly test [q`h']filipresdistlewiszbtoplev2 = [q`h']senpartydiffmedlewiszbtoplev2 = [q`h']agencyindzbtoplev2 = [q`h']zloyalmedianzbtoplev2 = 0   
gen pointestimates`h' = r(chi2)
gen pval`h' = r(p)
putexcel A`i'= `h'
putexcel B`i'= (r(chi2))
putexcel C`i'=(r(p))
local i=`i'+1
}
import excel "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use2wald.xlsx", sheet("Sheet1") clear
replace B = round(B,.01)
replace C = round(C,.01)
replace C = .01 if C == 0
generate group = . 
replace group = 1 if C > 0.10
replace group = 2 if C <= 0.10 & C > 0.05
replace group = 3 if C <= 0.05 & C > 0.01
replace group = 4 if C <=0.01

twoway (bar B A, sort xlabel(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ylabel(0(10)30, angle(0)) ytitle("Wald Chi-Square Test Statistic", size(medsmall)) xtitle("Quantiles", size(medsmall)) title("FIGURE I.2: Informational Vetting Confirmation Delay Model", size(medium)) subtitle("(Wald Tests: Joint Significance of Conditional Agency Hierarchy Position Effects)", size(medsmall)) legend(off)) ///
       (bar B A if group == 1, barwidth(2) fcolor(white)) ///
       (bar B A if group == 2, barwidth(2) fcolor(gs13)) ///
	   (bar B A if group == 3, barwidth(2) fcolor(gs7)) ///
	   (bar B A if group == 4, barwidth(2) fcolor(black)) ///
	   (scatter B A, msymbol(none) mlabel(C) mlabposition(12) mlabgap(zero))
	   
graph save "Graph" "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/FigureI2.gph"

graph export "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/EPS/Appendix I/FigureI2.eps"

***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
 

 
 

*** PART 3: MODELS ANALYZING PROCEDURAL VETTING ON SENATE FLOOR STAGE [CONFIRMATION DATE - REPORTED OUT OF SENATE COMMITTEE DATE] *** 


use "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Data/Confirmation Dynamics.Database.08-13-2020.FINAL.dta", replace


*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


                                                                                                                                                                                                                                                                   

*** MODEL 3: PREDICTING TIME FROM REPORTED OUT OF SENATE COMMITTEE TO CONFIRMATION ON SENATE FLOOR [POLVETDUR] - NON-AUGMENTED MODEL (DOES NOT ACCOUNT FOR SAMPLE SELECTION BIAS) ****


 
*** ASYMMETRIC LAPLACE MLE CONDITIONAL QUANTILE SURVIVAL REGRESSION PERCENTILES ["DUE DILIGENCE" MODEL] ***


laplacereg polvetdur  filipresdistancelewiszb filipresdistlewiszbtoplev2  senpartydiffmedianlewiszb senpartydiffmedlewiszbtoplev2  senworkload senhearing excalendarcong ///
senmajagencyideoloppose senmajagencyideolalign agencyindzb  agencyindzbtoplev2  soucountagency1  presappnom endsession newpresterm fvatreated ///
toplevel2 zloyalmedianzb zloyalmedianzbtoplev2 zmecompmedian zpecompmedian  gender minority admintermyr1  admintermyr2 admintermyr3 ///
bush41 clinton bush43 if confirmselectin==1, failure(confirmobserved) quantiles (1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ///
seed(123) reps(1000)
*
estimates store model3
estout model3, cells(b(star fmt(3)) se(par fmt(2)))




*** WALD TESTS FOR JOINT COEFFICIENT EQUALITY AMONG CONDITIONAL EFFECTS POSITED BY H1-H4 IN MANUSCRIPT ***

** NULL HYPOTHESIS: EQUIVALENT TO MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
** ALTERNATIVE HYPOTHESIS: REJECT EQUIVALENCE OF MCCARTY AND RAZAGHIAN (1999) AGENCY HIERARCHY HYPOTHESIS ADDITIVE/UNCONDITIONAL FORMULATION **
*
*
test [q01]filipresdistlewiszbtoplev2 = [q01]senpartydiffmedlewiszbtoplev2 = [q01]agencyindzbtoplev2 = [q01]zloyalmedianzbtoplev2 = 0
*
test [q05]filipresdistlewiszbtoplev2 = [q05]senpartydiffmedlewiszbtoplev2 = [q05]agencyindzbtoplev2 = [q05]zloyalmedianzbtoplev2 = 0
*
test [q10]filipresdistlewiszbtoplev2 = [q10]senpartydiffmedlewiszbtoplev2 = [q10]agencyindzbtoplev2 = [q10]zloyalmedianzbtoplev2 = 0
*
test [q15]filipresdistlewiszbtoplev2 = [q15]senpartydiffmedlewiszbtoplev2 = [q15]agencyindzbtoplev2 = [q15]zloyalmedianzbtoplev2 = 0
*
test [q20]filipresdistlewiszbtoplev2 = [q20]senpartydiffmedlewiszbtoplev2 = [q20]agencyindzbtoplev2 = [q20]zloyalmedianzbtoplev2 = 0
*
test [q25]filipresdistlewiszbtoplev2 = [q25]senpartydiffmedlewiszbtoplev2 = [q25]agencyindzbtoplev2 = [q25]zloyalmedianzbtoplev2 = 0
*
test [q30]filipresdistlewiszbtoplev2 = [q30]senpartydiffmedlewiszbtoplev2 = [q30]agencyindzbtoplev2 = [q30]zloyalmedianzbtoplev2 = 0
*
test [q35]filipresdistlewiszbtoplev2 = [q35]senpartydiffmedlewiszbtoplev2 = [q35]agencyindzbtoplev2 = [q35]zloyalmedianzbtoplev2 = 0
*
test [q40]filipresdistlewiszbtoplev2 = [q40]senpartydiffmedlewiszbtoplev2 = [q40]agencyindzbtoplev2 = [q40]zloyalmedianzbtoplev2 = 0
*
test [q45]filipresdistlewiszbtoplev2 = [q45]senpartydiffmedlewiszbtoplev2 = [q45]agencyindzbtoplev2 = [q45]zloyalmedianzbtoplev2 = 0
*
test [q50]filipresdistlewiszbtoplev2 = [q50]senpartydiffmedlewiszbtoplev2 = [q50]agencyindzbtoplev2 = [q50]zloyalmedianzbtoplev2 = 0
*
test [q55]filipresdistlewiszbtoplev2 = [q55]senpartydiffmedlewiszbtoplev2 = [q55]agencyindzbtoplev2 = [q55]zloyalmedianzbtoplev2 = 0
*
test [q60]filipresdistlewiszbtoplev2 = [q60]senpartydiffmedlewiszbtoplev2 = [q60]agencyindzbtoplev2 = [q60]zloyalmedianzbtoplev2 = 0
*
test [q65]filipresdistlewiszbtoplev2 = [q65]senpartydiffmedlewiszbtoplev2 = [q65]agencyindzbtoplev2 = [q65]zloyalmedianzbtoplev2 = 0
*
test [q70]filipresdistlewiszbtoplev2 = [q70]senpartydiffmedlewiszbtoplev2 = [q70]agencyindzbtoplev2 = [q70]zloyalmedianzbtoplev2 = 0
*
test [q75]filipresdistlewiszbtoplev2 = [q75]senpartydiffmedlewiszbtoplev2 = [q75]agencyindzbtoplev2 = [q75]zloyalmedianzbtoplev2 = 0
*
test [q80]filipresdistlewiszbtoplev2 = [q80]senpartydiffmedlewiszbtoplev2 = [q80]agencyindzbtoplev2 = [q80]zloyalmedianzbtoplev2 = 0
*
test [q85]filipresdistlewiszbtoplev2 = [q85]senpartydiffmedlewiszbtoplev2 = [q85]agencyindzbtoplev2 = [q85]zloyalmedianzbtoplev2 = 0
*
test [q90]filipresdistlewiszbtoplev2 = [q90]senpartydiffmedlewiszbtoplev2 = [q90]agencyindzbtoplev2 = [q90]zloyalmedianzbtoplev2 = 0
*
test [q95]filipresdistlewiszbtoplev2 = [q95]senpartydiffmedlewiszbtoplev2 = [q95]agencyindzbtoplev2 = [q95]zloyalmedianzbtoplev2 = 0
*
test [q99]filipresdistlewiszbtoplev2 = [q99]senpartydiffmedlewiszbtoplev2 = [q99]agencyindzbtoplev2 = [q99]zloyalmedianzbtoplev2 = 0
*
*
*
putexcel set "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use3wald.xlsx", modify
local i=1
foreach h in 01 05 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99 {
quietly test [q`h']filipresdistlewiszbtoplev2 = [q`h']senpartydiffmedlewiszbtoplev2 = [q`h']agencyindzbtoplev2 = [q`h']zloyalmedianzbtoplev2 = 0   
gen pointestimates`h' = r(chi2)
gen pval`h' = r(p)
putexcel A`i'= `h'
putexcel B`i'= (r(chi2))
putexcel C`i'=(r(p))
local i=`i'+1
}
import excel "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/use3wald.xlsx", sheet("Sheet1") clear
replace B = round(B,.01)
replace C = round(C,.01)
replace C = .01 if C == 0
replace C = .99 if C == 1
generate group = . 
replace group = 1 if C > 0.10
replace group = 2 if C <= 0.10 & C > 0.05
replace group = 3 if C <= 0.05 & C > 0.01
replace group = 4 if C <=0.01

twoway (bar B A, sort xlabel(1 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 99) ylabel(0(10)90, angle(0)) ytitle("Wald Chi-Square Test Statistic", size(medsmall)) xtitle("Quantiles", size(medsmall)) title("FIGURE I.3: Procedural Vetting Confirmation Delay Model", size(medium)) subtitle("(Wald Tests: Joint Significance of Conditional Agency Hierarchy Position Effects)", size(medsmall)) legend(off)) ///
       (bar B A if group == 1, barwidth(2) fcolor(white)) ///
       (bar B A if group == 2, barwidth(2) fcolor(gs13)) ///
	   (bar B A if group == 3, barwidth(2) fcolor(gs7)) ///
	   (bar B A if group == 4, barwidth(2) fcolor(black)) ///
	   (scatter B A, msymbol(none) mlabel(C) mlabposition(12) mlabgap(zero))
	   
graph save "Graph" "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/Appendix I/FigureI3.gph"

graph export "/Users/JAYBYERS/Dropbox/Jason Byers/Co-Authored Projects/Projects with Krause/Krause Projects/Confirmation Dynamics Project/Nominee Characteristics Project/JOPDRMJB/Graphics/EPS/Appendix I/FigureI3.eps"

*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
 

log close





